<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script language="JavaScript" src="js/index.js"></script>
</head>
<body>
<div>
    水果系统
</div>
<form th:action="@{/fruit.do}" method="post">
    <input type="hidden" name="operate" value="queryByPost"><br/>
    <input type="text" name="keyword" th:value="${session.queryParem}"><br/>
    <input type="submit" value="查询">

</form>
<table>
    <a th:href="@{/add.html}">新增水果</a >


    <tr>
        <td>名字</td>
        <td>价格</td>
        <td>数量</td>
        <td>备注</td>
        <td>操作</td>
    </tr>
    <tr th:if="${#lists.isEmpty(list)}">
        <td>库存为空</td>
    </tr>
    <tr th:unless="${#lists.isEmpty(list)}" th:each="item : ${list}">
        <td>
            <a th:text="${item.fname}"></a >
        </td>
        <td th:text="${item.price}">
        </td>
        <td th:text="${item.fcount}">
        </td>
        <td th:text="${item.remark}">
        </td>
        <td><input type="button" value="删除" th:onclick="|del(${item.fid})|"></td>
        <td><a th:href="@{/fruit.do?(fid=${item.fid},operate = 'edit')}" th:text="编辑"></a ></td>
    </tr>


</table>
<table>
    <tr>
        <td><input type="button" value="首页" th:onclick="|page(1)|" th:disabled="${pageNo==1}"></td>
        <td><input type="button" value="上一页" th:onclick="|page(${pageNo-1})|"
                   th:disabled="${pageNo==1}"></td>
        <td><input type="button" value="下一页" th:onclick="|page(${pageNo+1})|"
                   th:disabled="${pageNo==pageCount}">
        </td>
        <td><input type="button" value="尾页" th:onclick="|page(${pageCount})|"
                   th:disabled="${pageNo==pageCount}"></td>
        <td th:text="${count}"></td>
    </tr>

</table>


</body>
</html>